#ifndef CORECONTROLLER_H
#define CORECONTROLLER_H

#include <QObject>
#include "coreserver.h"
#include "qxmpp/QXmppMessage.h"

class QSqlDatabase;
class DatabaseConnection;

class CoreController : public QObject
{
Q_OBJECT
public:
    explicit CoreController(QObject *parent = 0);

signals:
    void authenticated(int);
public slots:
    void authenticationRequest(QString username, QString password);
    void buddyListRequest(QString username,QString accountJid);
    void clientMessageReceived(QXmppMessage);
    void setConnectionState(QString username, QString jid, QString state);
    void getConnectionState(QString username, QString jid);
    void connectXMLTools(QString id);

private:
    CoreServer* server;
    QSettings* settings;
    DatabaseConnection* dbconn;
    void stateChanged(QString from,QXmppMessage::State state,int accID,int uid);
    void msgRecv(QString from,QString to, QString msg,int accID,int uid);


};

#endif // CORECONTROLLER_H
